//
//  WLSegmentTitleView.h
//  LiveEducation
//
//  Created by Liu,Qingcan on 2017/4/16.
//  Copyright © 2017年 Baidu. All rights reserved.
//

#import <UIKit/UIKit.h>

@class WLSegmentTitleView;

typedef NS_ENUM(NSInteger,WLSegmentTitleStyle) {
    WLSegmentTitleStyleBottomIndicatorLine,
    WLSegmentTitleStyleCenterCircle,
    WLSegmentTitleStyleBackImage,
    WLSegmentTitleStyleBottomIndicatorImage
};

@protocol WLSegmentTitleDelegate <NSObject>

@optional
- (void)didSelectedSegmentTitle:(WLSegmentTitleView *)titleView atIndex:(NSInteger)index;

/** 文字渐显、缩放效果的实现（给外界 scrollViewDidScroll 提供的方法 -> 可供选择） */
- (void)selectedTitleBtnColorGradualChangeScrollViewDidScroll:(WLSegmentTitleView *)scrollView;
@end


@interface WLSegmentTitleView : UIScrollView

@property (nonatomic,weak)id <WLSegmentTitleDelegate> wl_delegate;

@property (nonatomic,strong)UIColor *titleColor;//默认灰色
@property (nonatomic,strong)UIColor *titleSelectColor;//选中时的颜色
@property (nonatomic,strong)UIColor *indicatorColor;//默认主题色调 -- 天蓝
//@property (nonatomic,strong)UIImage *indicatorImage;
@property (nonatomic,strong)UIImage *segmentBackImage;

@property (nonatomic,assign)WLSegmentTitleStyle segmentStyle;//默认底部指示器样式

- (instancetype)initWithFrame:(CGRect)frame
                     delegate:(id)delegate
                  childTitles:(NSArray *)title
             isScaleTitleText:(BOOL)isScale
                     isScroll:(BOOL)isScroll;

+ (instancetype)initWithFrame:(CGRect)frame
                     delegate:(id)delegate
                  childTitles:(NSArray *)title
             isScaleTitleText:(BOOL)isScale
                     isScroll:(BOOL)isScroll;


//@property (nonatomic, assign) BOOL titleColorGradualChange;
/** 标题文字缩放效果(默认为NO), 与selectedTitleBtnColorGradualChangeScrollViewDidScroll方法，一起才会生效 */
@property (nonatomic, assign) BOOL titleFontGradualChange;

//@property (nonatomic, assign , readonly) BOOL titleViewCannotScroll;


- (void)changeTitleButtonPosition:(UIScrollView *)scrollView;

- (void)selecteTitleBtnGradualChangeWhenScrollViewDidScroll:(UIScrollView *)scrollview;

@end
